package com.nidu.demo.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 文件存储类型枚举
 *
 * @author auto
 */
@Getter
@AllArgsConstructor
public enum FileStorageTypeEnum {

    LOCAL(1, "本地存储"),
    ALIYUN_OSS(2, "阿里云OSS"),
    TENCENT_COS(3, "腾讯云COS"),
    MINIO(4, "MinIO");

    private final Integer type;
    private final String name;

    public static FileStorageTypeEnum valueOf(Integer type) {
        for (FileStorageTypeEnum value : values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        throw new IllegalArgumentException("未知的文件存储类型：" + type);
    }
}
